package com.lsongh.springboot2.service;

import com.lsongh.springboot2.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

public interface UserService  extends JpaRepository<User,Integer> {

    public  User findByName(String name);
    public User findByAccount(String account);

    //获取所有新闻（没有假删除的数据）
//    @Query("select a from User a  where a.delete = ?1 and a.name  like concat('%' ,?2 , '%')  order by a.id desc ")
//    List<User> findAllUsersByName(Integer isDelete, String name);
    //获取所有新闻（没有假删除的数据）
//    @Query("select a from User a  where a.delete = ?1 order by a.id desc ")
//    List<User> findAllUsers(Integer isDelete);
    public List<User> findAllByNameLike(String name);

    public List<User> findAllByType(String name);
}
